<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="utf-8">

    <title>easy java document | easy-java </title>
    <meta name="description" content>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    

    <!-- fonts -->
    <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Ubuntu:300,400,500,600,700" rel="stylesheet">

    <!-- stylesheets -->
    <link rel="stylesheet" href="/ejdoc/style/doc.css">

    <!-- favicon -->
    <link rel="icon" href="/ejdoc/images/favicon.ico">

    

  </head>
  <body>

   <script>window.__INITIAL_STATE__ = {"page":{"title":"easy-java","path":"o2m.html"},"data":{"navigation":{"logo":{"text":"Easy Java","type":"link","path":"index.html"},"main":[{"text":"工作流与业务流集合","type":"link","path":"wf3.html"},{"text":"一对多关联V2.0","type":"link","path":"o2m.html"}]},"navigation.yaml":"{\n  \"logo\": {\n    \"text\": \"Easy Java\",\n    \"type\": \"link\",\n    \"path\": \"index.html\"\n  },\n  \"main\": [\n    {\n        \"text\": \"如何让你的项目快人N步?\",\n        \"type\": \"link\",\n        \"path\": \"index.html\"\n    },\n    {\n        \"text\": \"起步（从无到有）\",\n        \"type\": \"link\",\n        \"path\": \"build-code.html\"\n    },\n    {\n        \"text\": \"项目演示地址\",\n        \"type\": \"link\",\n        \"path\": \"show.html\"\n    },\n    {\n        \"text\": \"安装\",\n        \"type\": \"link\",\n        \"path\": \"install.html\"\n    },\n    {\n        \"text\": \"功能介绍\",\n        \"type\": \"link\",\n        \"path\": \"function1.html\"\n    },\n    {\n        \"text\": \"动态工作流-内置表单\",\n        \"type\": \"link\",\n        \"path\": \"workflow1.html\"\n    },\n    {\n        \"text\": \"动态工作流-外置表单\",\n        \"type\": \"link\",\n        \"path\": \"workflow2.html\"\n    },\n    {\n        \"text\": \"分布式定时任务\",\n        \"type\": \"link\",\n        \"path\": \"timer.html\"\n    },\n    {\n        \"text\": \"升级日志\",\n        \"type\": \"link\",\n        \"path\": \"log-20200517.html\"\n    },\n    {\n        \"text\": \"计划\",\n        \"type\": \"link\",\n        \"path\": \"future.html\"\n    },\n    {\n        \"text\": \"有Bug及时发我完善\",\n        \"type\": \"label\"\n    }\n  ]\n}\n"},"config":{"timezone":"UTC","root":"/ejdoc/","time_format":"HH:mm:ss","theme":"../node_modules/hexo-theme-doc","theme_config":{"swagger_ui":{"version":2,"permalinks":true,"api_explorer":true,"download":"Download specification","show_extensions":false,"deep_linking":true,"display_operation_id":false,"doc_expansion":"none"},"search":{"skip":false,"background":false,"route":"/lunr.json"},"favicon":"images/favicon.ico"}}}</script>

    <div id="react-navigation-root"><div class="doc-navigation" data-reactroot><nav class="doc-navbar"><a href="/ejdoc/index.html" class="doc-navbar__logo"><img src="/ejdoc/images/logo.png" class="doc-navbar__logo__img"><span class="doc-navbar__logo__text">Easy Java</span></a><i class="dc-icon dc-icon--close dc-icon--interactive doc-sidebar-close doc-navbar__sidebar-close doc-navbar__sidebar-close--desktop"></i><i class="dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle doc-navbar__sidebar-toggle"></i></nav><nav class="doc-sidebar"><div class="doc-sidebar__vertical-menu"><i class="dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle doc-sidebar-toggle--primary doc-sidebar__vertical-menu__item"></i><i class="dc-icon dc-icon--search dc-icon--interactive doc-sidebar__vertical-menu__item doc-sidebar__vertical-menu__item--primary"></i></div><div class="doc-sidebar-content"><div class="doc-sidebar__search-form"></div><ul class="doc-sidebar-list"></ul></div></nav></div></div>
    <div class="doc-content">
  <div class="dc-page">
    <div class="dc-card">
      <div id="react-search-results-root"></div>
      <div id="page-content" class="doc-formatting">
        <p>一对多源码生成器，升级了<br>原：生成源码时，一个主表只支持一个子表关联，生成一个子表的主从表页面和相应功能。<br>新：支持一主多从<br>配置方法如下，重点看otm这个节点，老版本是一个json对象，现在是json列表：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="string">"tree"</span>: &#123;</span><br><span class="line">    <span class="string">"desc"</span>: <span class="string">"树结构，默认是自动寻找‘表名_id’字段作外键，生成自关联树"</span>,</span><br><span class="line">    <span class="string">"enable"</span>: <span class="literal">false</span>,</span><br><span class="line">    <span class="string">"label"</span>: <span class="string">"name"</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="string">"otm"</span>: [</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">"desc"</span>: <span class="string">"OneToMany: 一对多中子表信息; column: 主表的关联字段，默认是ID; slaveColumn子表字段，外键。"</span>,</span><br><span class="line">      <span class="string">"column"</span>: <span class="string">"id"</span>,</span><br><span class="line">      <span class="string">"enable"</span>: <span class="literal">true</span>,</span><br><span class="line">      <span class="string">"slaveTableName"</span>: <span class="string">"ctc_task_son"</span>,</span><br><span class="line">      <span class="string">"slaveColumn"</span>: <span class="string">"ctc_task_id"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">"desc"</span>: <span class="string">"OneToMany"</span>,</span><br><span class="line">      <span class="string">"enable"</span>: <span class="literal">true</span>,</span><br><span class="line">      <span class="string">"column"</span>: <span class="string">"task_number"</span>,</span><br><span class="line">      <span class="string">"slaveTableName"</span>: <span class="string">"ctc_img"</span>,</span><br><span class="line">      <span class="string">"slaveColumn"</span>: <span class="string">"number"</span></span><br><span class="line">    &#125;</span><br><span class="line">  ],</span><br><span class="line">  <span class="string">"asideTree"</span>: &#123;</span><br><span class="line">    <span class="string">"desc"</span>: <span class="string">"左树右列表结构：左树是主表，右列表是子表"</span>,</span><br><span class="line">    <span class="string">"enable"</span>: <span class="literal">false</span>,</span><br><span class="line">    <span class="string">"fatherTableName"</span>: <span class="string">""</span>,</span><br><span class="line">    <span class="string">"sonTableName"</span>: <span class="string">"tmpt_auth_user"</span></span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>配置了两个子表，主页面实时加载，显示2个子表信息。<br><img src="./images/o2m/o2m-1.png" width="1000"></p>
<p>配置了两个子表，这个就有两个一对多查询菜单。<br><img src="./images/o2m/o2m-2.png" width="1000"></p>

        <div id="react-support-footer-root"></div>
      </div>
    </div>
  </div>
</div>

    


    

    <!-- js vendors -->
    <script src="//code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/lunr.js/2.1.0/lunr.min.js"></script>

    <!-- js source  -->
    <script src="/ejdoc/script/doc.js"></script>

    

  </body>
</html>
